package cloudspace.ui.applet.io;

import java.io.File;
import java.io.FileDescriptor;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;


public class CloudFileReader extends InputStreamReader
{
    /**
     * Creates a new <tt>FileReader</tt>, given the name of the file to read
     * from.
     * 
     * @param fileName
     *            the name of the file to read from
     * @exception FileNotFoundException
     *                if the named file does not exist, is a directory rather
     *                than a regular file, or for some other reason cannot be
     *                opened for reading.
     */
    public CloudFileReader( String fileName ) throws FileNotFoundException
    {
        super( new CloudFileInputStream( fileName ) );
    }


    /**
     * Creates a new <tt>FileReader</tt>, given the <tt>File</tt> to read from.
     * 
     * @param file
     *            the <tt>File</tt> to read from
     * @exception FileNotFoundException
     *                if the file does not exist, is a directory rather than a
     *                regular file, or for some other reason cannot be opened
     *                for reading.
     */
    public CloudFileReader( File file ) throws FileNotFoundException
    {
        super( new CloudFileInputStream( file.getPath() ) );
    }


    /**
     * Creates a new <tt>FileReader</tt>, given the <tt>FileDescriptor</tt> to
     * read from.
     * 
     * @param fd
     *            the FileDescriptor to read from
     */
    public CloudFileReader( FileDescriptor fd )
    {
        super( new CloudFileInputStream( fd ) );
    }
}
